import { Component, OnInit } from '@angular/core';
declare var $:any;

@Component({
  selector: 'app-middlebanner',
  templateUrl: './middlebanner.component.html',
  styleUrls: ['./middlebanner.component.css']
})
export class MiddlebannerComponent implements OnInit {
  // 机器申请
  jiqishenqing(){
    $('.modal-title').empty();
		$('.modal-body').empty();
		$('.modal-footer').empty();
		var str = '机器申请';
		$('.modal-title').html(str);
		var html = '';
		html +=`<div>
					<div class="jiqi bodyborder">
						<button type="button" class="btnstygeen yikatong" onclick="yikatong()">一卡通</button>
						<button type="button" class="btnstygray ranqi" onclick="ranqi()">燃气</button>
					</div>
					<div class="jiqi">
						<div class="mt5">1.一卡通机器押金300元，从订货账户扣除</div>
						<div class="mt10">2.燃气机器押金300元，从订货账户扣除</div>
					</div>
				</div>`
		$('.modal-body').append(html);
		var html1= '';
		html1 +=`<div>
					<button type="button" class="btn btn-primary sure btn-mian"  (click)="sure()">确认提交</button>
					<button type="button" class="btn btn-default " data-dismiss="modal">暂不提交</button>
		         </div>`
		$('.modal-footer').append(html1);
    // 改变机器申请里面确认提交的内容
    // 改变确认提交的内容
    var one = 0;
    function sure(){
        one ++;
        $('#myModal').modal('hide');
        $('.successnew').empty()
        $('.successnew').show()
        $('body').removeClass('modal-open').css('padding-right','');
        console.log(one);
        if(one == 1){
             var html = '';
             html +='<div><a onclick="xxx()" class="xxx">X</a><span  class="change">购买成功，业务经理会及时送货上门</span></div>';
             $('.successnew').append(html);
            
        }
        else if(one == 2){
             var html = '';
             html +='<div><a onclick="xxx()" class="xxx">X</a><span  class="change">30分钟内不能再次点击</span></div>';
             $('.successnew').append(html);
           
        }
       
    }
   
    function xxx(){
        $('.successnew').hide()
        $('.modal-backdrop').remove();
    }
  }
  // 客户经理
  manager(){
      $('.modal-title').empty();
      $('.modal-body').empty();
      $('.modal-footer').empty();
      var str = '你的客户经理';
      $('.modal-title').html(str);
      var html = '';
      html +=`<div>
            <div class="pr10 pl10 clearfix">
              <div style="float:left;width:50%">
                <div>姓名：瑞业务</div>
                <div>职位：业务经理主管</div>
                <div>性别：男</div>
                <div>电话：18625506005</div>
                <div>提示：<span class="color-main">动态令牌收取30元押金</span></div>
              </div>
              <div style="float:left;width:50%;text-align:center">
                <img src="images/avatar.png"/>
              </div>
            </div>
          </div>`
      $('.modal-body').append(html);
      var html1= '';
      html1 +=`<div style="text-align: left;">
            <p>亲，我是您的客户经理 <span class="color-main">瑞业务</span>，竭诚为您服务，请随时拨打我的手机 <span class="color-main">18625506005</span>，为您服务！</p>
            <p class="color-999"><span class="color-sec">温馨提醒：</span>近期有不少不法分子、前离职人员冒充爱便利客户经理的同事、朋友去店里收取充值款，为了避免给您的财产造成，如遇到此类情况请务必与您的客户经理进行核对，如遇到冒充分子可直接报警。爱便利感谢您的合作，祝您猴年走大运，发大财！</div>
              </p>`
      $('.modal-footer').append(html1);
  }

  constructor() { }

  ngOnInit() {
  }

}
